/*
 * Copyright (c) 2013 WDCY Information Technology Co. Ltd
 * www.wdcy.cc
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * WDCY Information Technology Co. Ltd ("Confidential Information").
 * You shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement you
 * entered into with WDCY Information Technology Co. Ltd.
 */
package com.monkey.web.dto.response.user;


import com.monkey.core.domain.user.User;
import com.monkey.core.domain.user.UserStatus;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @author Wu Tianqiang
 */
public class UserJSONDto {

    private Long id;
    private Date createTime;
    private String account;
    private String nick;
    private String email;
    private String mobile;
    private Boolean deleted;
    private UserStatus status;

    public UserJSONDto(User user) {
        this.id = user.getId();
        this.createTime = user.getCreateTime();
        this.account = user.getAccount();
        this.nick = user.getNick();
        this.email = user.getEmail();
        this.mobile = user.getMobile();
//        this.deleted = user.getDeleted();
        this.status = user.getStatus();
    }

    public static List<UserJSONDto> toJSONDto(List<User> users) {
        List<UserJSONDto> userDtos = new ArrayList<>();
        for (User user : users) {
            userDtos.add(new UserJSONDto(user));
        }
        return userDtos;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getNick() {
        return nick;
    }

    public void setNick(String nick) {
        this.nick = nick;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public Boolean getDeleted() {
        return deleted;
    }

    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }

    public UserStatus getStatus() {
        return status;
    }

    public void setStatus(UserStatus status) {
        this.status = status;
    }


}